package com.baidu.disk.action;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

/**
 * Created by CJ on 2018-02-27.
 */

//@Controller         //直接String作为返回值即可
    @RestController  //需要使用ModelAndView作为返回值
public class IndexContrller {

    @RequestMapping(value = "/index")
    public String index(){
        return "index";
    }

    @GetMapping("/index1")
    public ModelAndView index1(){
        ModelAndView model = new ModelAndView("/index");
        return model;
    }
}
